package edu.sctu.fengleilin.month06.day150607;

/**
 * Created by user09 on 2015/6/7.
 */
public class ThreadUtil extends Thread {
    private int time;

    public ThreadUtil(int time){
        this.time = time;
    }
    public void startThread(){
        new Thread(){
            @Override
         public void run(){
             super.run();
             for (int i = 0;i < time;i ++){
                 System.out.println(i);
                 try{
                     Thread.sleep(1000);
                 } catch (InterruptedException e) {
                     e.printStackTrace();
                 }
             }
         }
        }.start();
    }
    public void sysTem(){
        System.out.println(100);
    }
    public void startRunable(){
        Thread thread = new Thread(new ThreadRunable());
        thread.start();
    }
}
